package com.lwm.proxy.agent;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author liweimin
 * @date 2021/6/10 17:31
 * @since
 */
public class ProducerProxy implements InvocationHandler {

    private Object object;

    public ProducerProxy(Object object) {
        this.object = object;
    }

    public ProducerProxy() {
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("开始调用程序");
        Object invoke = method.invoke(object, args);
        System.out.println("调用程序结束");
        return invoke;
    }
}
